import * as React from 'react';
import {
    Text, View, TextInput, StyleSheet, Image,
    TouchableOpacity, ScrollView, Switch,
} from 'react-native';
import { WebView } from 'react-native-webview';
import ImagePicker from 'react-native-image-crop-picker';
export default class Icon extends React.Component {
    render() {
        return (
            <View >
                <TouchableOpacity onPress = {()=>{
                    ImagePicker.openPicker({
                        width: 300,
                        height: 400,
                        cropping: true
                    }).then(image => {
                        console.log(image);
                    });
                }}>
                    <Text style = {{color:"#F00",fontSize:30}}>打开相册</Text>
                </TouchableOpacity>
                <TouchableOpacity onPress = {()=>{
                    ImagePicker.openCamera({
                        width: 300,
                        height: 400,
                        cropping: true,
                    }).then(image => {
                        console.log(image);
                    });
                }}>
                    <Text style = {{color:"#F00",fontSize:30}}>打开摄像头</Text>
                </TouchableOpacity>
            </View>
        );
    }

}
const styles = StyleSheet.create({

});
//Z自定义组件封装导出
module.exports = Icon
